package main;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JButton;

@SuppressWarnings("serial")
public class Main extends JFrame{

	public Main() {		
		JButton botao = new JButton("OI");
		botao.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				JButton source = (JButton) e.getSource();
				if(source.getText().compareTo("OI") == 0)
					source.setText("TCHAU");
				else
					source.setText("OI");
			}
		});
		
		this.setLayout(new BorderLayout());
		this.add(botao, BorderLayout.CENTER);
		this.setSize(200, 200);
		this.setLocationRelativeTo(null);
		this.setVisible(true);
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new Main();
	}

}
